package com.imooc.es.pojo.vo;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * 如果是es7不用写type
 * @author 顾志杰
 * @date 2020/8/20-9:30
 */
@Document(indexName = "foodie-items-ik",type = "doc",createIndex = false)
@Data
public class Items {

    @Id
    @Field(store = true,type = FieldType.Text,index = false)
    private String itemId;

    @Field(store = true,type = FieldType.Text,index = true,searchAnalyzer = "ik_smart")
    private String itemName;

    @Field(store = true,type = FieldType.Text,index = false)
    private String imgUrl;

    @Field(store = true,type = FieldType.Integer)
    private Integer price;

    @Field(store = true,type = FieldType.Integer)
    private Integer sellCounts;


}
